Integrand size = 39, antiderivative size = 125 \[ \int (a+a \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^5(c+d x) \, dx=\frac {a (3 A+4 (B+C)) \text {arctanh}(\sin (c+d x))}{8 d}-\frac {a (A+B-3 (A+B+C)) \tan (c+d x)}{3 d}+\frac {a (3 A+4 (B+C)) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a (A+B) \sec ^2(c+d x) \tan (c+d x)}{3 d}+\frac {a A \sec ^3(c+d x) \tan (c+d x)}{4 d} \]
1/8*a*(3*A+4*B+4*C)*arctanh(sin(d*x+c))/d-1/3*a*(-2*A-2*B-3*C)*tan(d*x+c)/ d+1/8*a*(3*A+4*B+4*C)*sec(d*x+c)*tan(d*x+c)/d+1/3*a*(A+B)*sec(d*x+c)^2*tan (d*x+c)/d+1/4*a*A*sec(d*x+c)^3*tan(d*x+c)/d
Time = 0.61 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.67 \[ \int (a+a \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^5(c+d x) \, dx=\frac {a \left (3 (3 A+4 (B+C)) \text {arctanh}(\sin (c+d x))+\tan (c+d x) \left (3 (3 A+4 (B+C)) \sec (c+d x)+6 A \sec ^3(c+d x)+8 \left (3 (A+B+C)+(A+B) \tan ^2(c+d x)\right )\right )\right )}{24 d} \]
(a*(3*(3*A + 4*(B + C))*ArcTanh[Sin[c + d*x]] + Tan[c + d*x]*(3*(3*A + 4*( B + C))*Sec[c + d*x] + 6*A*Sec[c + d*x]^3 + 8*(3*(A + B + C) + (A + B)*Tan [c + d*x]^2))))/(24*d)
Time = 0.84 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.02, number of steps used = 14, number of rules used = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 3510, 25, 3042, 3500, 3042, 3227, 3042, 4254, 24, 4255, 3042, 4257}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sec ^5(c+d x) (a \cos (c+d x)+a) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a \sin \left (c+d x+\frac {\pi }{2}\right )+a\right ) \left (A+B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^5}dx\) |
\(\Big \downarrow \) 3510 |
\(\displaystyle \frac {a A \tan (c+d x) \sec ^3(c+d x)}{4 d}-\frac {1}{4} \int -\left (\left (4 a C \cos ^2(c+d x)+a (3 A+4 (B+C)) \cos (c+d x)+4 a (A+B)\right ) \sec ^4(c+d x)\right )dx\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {1}{4} \int \left (4 a C \cos ^2(c+d x)+a (3 A+4 (B+C)) \cos (c+d x)+4 a (A+B)\right ) \sec ^4(c+d x)dx+\frac {a A \tan (c+d x) \sec ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \int \frac {4 a C \sin \left (c+d x+\frac {\pi }{2}\right )^2+a (3 A+4 (B+C)) \sin \left (c+d x+\frac {\pi }{2}\right )+4 a (A+B)}{\sin \left (c+d x+\frac {\pi }{2}\right )^4}dx+\frac {a A \tan (c+d x) \sec ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3500 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \int (3 a (3 A+4 (B+C))+4 a (2 A+2 B+3 C) \cos (c+d x)) \sec ^3(c+d x)dx+\frac {4 a (A+B) \tan (c+d x) \sec ^2(c+d x)}{3 d}\right )+\frac {a A \tan (c+d x) \sec ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \int \frac {3 a (3 A+4 (B+C))+4 a (2 A+2 B+3 C) \sin \left (c+d x+\frac {\pi }{2}\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^3}dx+\frac {4 a (A+B) \tan (c+d x) \sec ^2(c+d x)}{3 d}\right )+\frac {a A \tan (c+d x) \sec ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3227 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (3 a (3 A+4 (B+C)) \int \sec ^3(c+d x)dx+4 a (2 A+2 B+3 C) \int \sec ^2(c+d x)dx\right )+\frac {4 a (A+B) \tan (c+d x) \sec ^2(c+d x)}{3 d}\right )+\frac {a A \tan (c+d x) \sec ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (4 a (2 A+2 B+3 C) \int \csc \left (c+d x+\frac {\pi }{2}\right )^2dx+3 a (3 A+4 (B+C)) \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx\right )+\frac {4 a (A+B) \tan (c+d x) \sec ^2(c+d x)}{3 d}\right )+\frac {a A \tan (c+d x) \sec ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 4254 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (3 a (3 A+4 (B+C)) \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx-\frac {4 a (2 A+2 B+3 C) \int 1d(-\tan (c+d x))}{d}\right )+\frac {4 a (A+B) \tan (c+d x) \sec ^2(c+d x)}{3 d}\right )+\frac {a A \tan (c+d x) \sec ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (3 a (3 A+4 (B+C)) \int \csc \left (c+d x+\frac {\pi }{2}\right )^3dx+\frac {4 a (2 A+2 B+3 C) \tan (c+d x)}{d}\right )+\frac {4 a (A+B) \tan (c+d x) \sec ^2(c+d x)}{3 d}\right )+\frac {a A \tan (c+d x) \sec ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 4255 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (3 a (3 A+4 (B+C)) \left (\frac {1}{2} \int \sec (c+d x)dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {4 a (2 A+2 B+3 C) \tan (c+d x)}{d}\right )+\frac {4 a (A+B) \tan (c+d x) \sec ^2(c+d x)}{3 d}\right )+\frac {a A \tan (c+d x) \sec ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (3 a (3 A+4 (B+C)) \left (\frac {1}{2} \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {4 a (2 A+2 B+3 C) \tan (c+d x)}{d}\right )+\frac {4 a (A+B) \tan (c+d x) \sec ^2(c+d x)}{3 d}\right )+\frac {a A \tan (c+d x) \sec ^3(c+d x)}{4 d}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {1}{4} \left (\frac {1}{3} \left (3 a (3 A+4 (B+C)) \left (\frac {\text {arctanh}(\sin (c+d x))}{2 d}+\frac {\tan (c+d x) \sec (c+d x)}{2 d}\right )+\frac {4 a (2 A+2 B+3 C) \tan (c+d x)}{d}\right )+\frac {4 a (A+B) \tan (c+d x) \sec ^2(c+d x)}{3 d}\right )+\frac {a A \tan (c+d x) \sec ^3(c+d x)}{4 d}\) |
(a*A*Sec[c + d*x]^3*Tan[c + d*x])/(4*d) + ((4*a*(A + B)*Sec[c + d*x]^2*Tan [c + d*x])/(3*d) + ((4*a*(2*A + 2*B + 3*C)*Tan[c + d*x])/d + 3*a*(3*A + 4* (B + C))*(ArcTanh[Sin[c + d*x]]/(2*d) + (Sec[c + d*x]*Tan[c + d*x])/(2*d)) )/3)/4
3.4.8.3.1 Defintions of rubi rules used
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x _)]), x_Symbol] :> Simp[c Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b Int [(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(A*b^2 - a*b*B + a^2*C))*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 1)* (a^2 - b^2))), x] + Simp[1/(b*(m + 1)*(a^2 - b^2)) Int[(a + b*Sin[e + f*x ])^(m + 1)*Simp[b*(a*A - b*B + a*C)*(m + 1) - (A*b^2 - a*b*B + a^2*C + b*(A *b - a*B + b*C)*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C}, x] && LtQ[m, -1] && NeQ[a^2 - b^2, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f _.)*(x_)]^2), x_Symbol] :> Simp[(-(b*c - a*d))*(A*b^2 - a*b*B + a^2*C)*Cos[ e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b^2*f*(m + 1)*(a^2 - b^2))), x] - S imp[1/(b^2*(m + 1)*(a^2 - b^2)) Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[b*( m + 1)*((b*B - a*C)*(b*c - a*d) - A*b*(a*c - b*d)) + (b*B*(a^2*d + b^2*d*(m + 1) - a*b*c*(m + 2)) + (b*c - a*d)*(A*b^2*(m + 2) + C*(a^2 + b^2*(m + 1)) ))*Sin[e + f*x] - b*C*d*(m + 1)*(a^2 - b^2)*Sin[e + f*x]^2, x], x], x] /; F reeQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && LtQ[m, -1]
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1) Subst[Int[Exp andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]
Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d* x]*((b*Csc[c + d*x])^(n - 1)/(d*(n - 1))), x] + Simp[b^2*((n - 2)/(n - 1)) Int[(b*Csc[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && IntegerQ[2*n]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Time = 9.64 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.09
method | result | size |
parts | \(\frac {a A \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}-\frac {\left (a A +B a \right ) \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )}{d}+\frac {\left (B a +a C \right ) \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}+\frac {a C \tan \left (d x +c \right )}{d}\) | \(136\) |
derivativedivides | \(\frac {-a A \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+B a \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a C \tan \left (d x +c \right )+a A \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )-B a \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+a C \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(174\) |
default | \(\frac {-a A \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+B a \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a C \tan \left (d x +c \right )+a A \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )-B a \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+a C \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) | \(174\) |
parallelrisch | \(\frac {11 \left (-\frac {6 \left (A +\frac {4 B}{3}+\frac {4 C}{3}\right ) \left (\frac {3}{4}+\frac {\cos \left (4 d x +4 c \right )}{4}+\cos \left (2 d x +2 c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{11}+\frac {6 \left (A +\frac {4 B}{3}+\frac {4 C}{3}\right ) \left (\frac {3}{4}+\frac {\cos \left (4 d x +4 c \right )}{4}+\cos \left (2 d x +2 c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{11}+\frac {8 \left (\frac {4 B}{3}+C +\frac {4 A}{3}\right ) \sin \left (2 d x +2 c \right )}{11}+\frac {\left (3 A +4 B +4 C \right ) \sin \left (3 d x +3 c \right )}{11}+\frac {4 \left (\frac {2 B}{3}+\frac {2 A}{3}+C \right ) \sin \left (4 d x +4 c \right )}{11}+\sin \left (d x +c \right ) \left (\frac {4 C}{11}+\frac {4 B}{11}+A \right )\right ) a}{4 d \left (\cos \left (4 d x +4 c \right )+4 \cos \left (2 d x +2 c \right )+3\right )}\) | \(194\) |
norman | \(\frac {\frac {a \left (7 A -4 B -4 C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {a \left (3 A +4 B +4 C \right ) \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {a \left (11 A -4 B +12 C \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}+\frac {a \left (13 A +12 B +12 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {a \left (43 A +28 B +12 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}+\frac {a \left (73 A -20 B -84 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}+\frac {a \left (89 A -4 B +60 C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{4}}-\frac {a \left (3 A +4 B +4 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {a \left (3 A +4 B +4 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) | \(276\) |
risch | \(-\frac {i a \left (9 A \,{\mathrm e}^{7 i \left (d x +c \right )}+12 B \,{\mathrm e}^{7 i \left (d x +c \right )}+12 C \,{\mathrm e}^{7 i \left (d x +c \right )}-24 C \,{\mathrm e}^{6 i \left (d x +c \right )}+33 A \,{\mathrm e}^{5 i \left (d x +c \right )}+12 B \,{\mathrm e}^{5 i \left (d x +c \right )}+12 C \,{\mathrm e}^{5 i \left (d x +c \right )}-48 A \,{\mathrm e}^{4 i \left (d x +c \right )}-48 B \,{\mathrm e}^{4 i \left (d x +c \right )}-72 C \,{\mathrm e}^{4 i \left (d x +c \right )}-33 A \,{\mathrm e}^{3 i \left (d x +c \right )}-12 B \,{\mathrm e}^{3 i \left (d x +c \right )}-12 C \,{\mathrm e}^{3 i \left (d x +c \right )}-64 A \,{\mathrm e}^{2 i \left (d x +c \right )}-64 B \,{\mathrm e}^{2 i \left (d x +c \right )}-72 C \,{\mathrm e}^{2 i \left (d x +c \right )}-9 A \,{\mathrm e}^{i \left (d x +c \right )}-12 B \,{\mathrm e}^{i \left (d x +c \right )}-12 C \,{\mathrm e}^{i \left (d x +c \right )}-16 A -16 B -24 C \right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}+\frac {3 a A \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{8 d}+\frac {B a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{2 d}-\frac {3 a A \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}-\frac {B a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{2 d}\) | \(380\) |
a*A/d*(-(-1/4*sec(d*x+c)^3-3/8*sec(d*x+c))*tan(d*x+c)+3/8*ln(sec(d*x+c)+ta n(d*x+c)))-(A*a+B*a)/d*(-2/3-1/3*sec(d*x+c)^2)*tan(d*x+c)+(B*a+C*a)/d*(1/2 *sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x+c)))+a*C/d*tan(d*x+c)
Time = 0.29 (sec) , antiderivative size = 143, normalized size of antiderivative = 1.14 \[ \int (a+a \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^5(c+d x) \, dx=\frac {3 \, {\left (3 \, A + 4 \, B + 4 \, C\right )} a \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (3 \, A + 4 \, B + 4 \, C\right )} a \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (8 \, {\left (2 \, A + 2 \, B + 3 \, C\right )} a \cos \left (d x + c\right )^{3} + 3 \, {\left (3 \, A + 4 \, B + 4 \, C\right )} a \cos \left (d x + c\right )^{2} + 8 \, {\left (A + B\right )} a \cos \left (d x + c\right ) + 6 \, A a\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \]
integrate((a+a*cos(d*x+c))*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^5,x, algorithm="fricas")
1/48*(3*(3*A + 4*B + 4*C)*a*cos(d*x + c)^4*log(sin(d*x + c) + 1) - 3*(3*A + 4*B + 4*C)*a*cos(d*x + c)^4*log(-sin(d*x + c) + 1) + 2*(8*(2*A + 2*B + 3 *C)*a*cos(d*x + c)^3 + 3*(3*A + 4*B + 4*C)*a*cos(d*x + c)^2 + 8*(A + B)*a* cos(d*x + c) + 6*A*a)*sin(d*x + c))/(d*cos(d*x + c)^4)
Timed out. \[ \int (a+a \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^5(c+d x) \, dx=\text {Timed out} \]
Time = 0.20 (sec) , antiderivative size = 218, normalized size of antiderivative = 1.74 \[ \int (a+a \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^5(c+d x) \, dx=\frac {16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} A a + 16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a - 3 \, A a {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, B a {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, C a {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, C a \tan \left (d x + c\right )}{48 \, d} \]
integrate((a+a*cos(d*x+c))*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^5,x, algorithm="maxima")
1/48*(16*(tan(d*x + c)^3 + 3*tan(d*x + c))*A*a + 16*(tan(d*x + c)^3 + 3*ta n(d*x + c))*B*a - 3*A*a*(2*(3*sin(d*x + c)^3 - 5*sin(d*x + c))/(sin(d*x + c)^4 - 2*sin(d*x + c)^2 + 1) - 3*log(sin(d*x + c) + 1) + 3*log(sin(d*x + c ) - 1)) - 12*B*a*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) - 12*C*a*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1)) + 48*C*a*tan(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 254 vs. \(2 (118) = 236\).
Time = 0.36 (sec) , antiderivative size = 254, normalized size of antiderivative = 2.03 \[ \int (a+a \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^5(c+d x) \, dx=\frac {3 \, {\left (3 \, A a + 4 \, B a + 4 \, C a\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (3 \, A a + 4 \, B a + 4 \, C a\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (9 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 12 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 12 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 49 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 28 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 60 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 31 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 52 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 84 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 39 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 36 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 36 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \]
1/24*(3*(3*A*a + 4*B*a + 4*C*a)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 3*(3* A*a + 4*B*a + 4*C*a)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(9*A*a*tan(1/2 *d*x + 1/2*c)^7 + 12*B*a*tan(1/2*d*x + 1/2*c)^7 + 12*C*a*tan(1/2*d*x + 1/2 *c)^7 - 49*A*a*tan(1/2*d*x + 1/2*c)^5 - 28*B*a*tan(1/2*d*x + 1/2*c)^5 - 60 *C*a*tan(1/2*d*x + 1/2*c)^5 + 31*A*a*tan(1/2*d*x + 1/2*c)^3 + 52*B*a*tan(1 /2*d*x + 1/2*c)^3 + 84*C*a*tan(1/2*d*x + 1/2*c)^3 - 39*A*a*tan(1/2*d*x + 1 /2*c) - 36*B*a*tan(1/2*d*x + 1/2*c) - 36*C*a*tan(1/2*d*x + 1/2*c))/(tan(1/ 2*d*x + 1/2*c)^2 - 1)^4)/d
Time = 5.48 (sec) , antiderivative size = 211, normalized size of antiderivative = 1.69 \[ \int (a+a \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^5(c+d x) \, dx=\frac {\left (-\frac {3\,A\,a}{4}-B\,a-C\,a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (\frac {49\,A\,a}{12}+\frac {7\,B\,a}{3}+5\,C\,a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-\frac {31\,A\,a}{12}-\frac {13\,B\,a}{3}-7\,C\,a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (\frac {13\,A\,a}{4}+3\,B\,a+3\,C\,a\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {a\,\mathrm {atanh}\left (\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (3\,A+4\,B+4\,C\right )}{2\,\left (\frac {3\,A\,a}{2}+2\,B\,a+2\,C\,a\right )}\right )\,\left (3\,A+4\,B+4\,C\right )}{4\,d} \]
(tan(c/2 + (d*x)/2)*((13*A*a)/4 + 3*B*a + 3*C*a) - tan(c/2 + (d*x)/2)^7*(( 3*A*a)/4 + B*a + C*a) - tan(c/2 + (d*x)/2)^3*((31*A*a)/12 + (13*B*a)/3 + 7 *C*a) + tan(c/2 + (d*x)/2)^5*((49*A*a)/12 + (7*B*a)/3 + 5*C*a))/(d*(6*tan( c/2 + (d*x)/2)^4 - 4*tan(c/2 + (d*x)/2)^2 - 4*tan(c/2 + (d*x)/2)^6 + tan(c /2 + (d*x)/2)^8 + 1)) + (a*atanh((a*tan(c/2 + (d*x)/2)*(3*A + 4*B + 4*C))/ (2*((3*A*a)/2 + 2*B*a + 2*C*a)))*(3*A + 4*B + 4*C))/(4*d)